package cn.enjoy.jetcache.controller;

import cn.enjoy.jetcache.entity.UserDO;
import cn.enjoy.jetcache.service.CacheServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author K
 * @date 2021/11/17 15:16
 */
@RequestMapping("jetcache")
@RestController
@AllArgsConstructor
public class JetcacheController {

    private CacheServiceImpl cacheService;


    @GetMapping("/user/save")
    public void saveUser(@RequestBody UserDO userDO) {
        cacheService.saveUser(userDO);
    }

    @PostMapping("/user/get")
    public UserDO getUser(@RequestBody UserDO userDO) {
        return cacheService.getUser(userDO);
    }

}
